package edu.sctu.xuping.month06.timeutil;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by user02 on 2015/6/26.
 */
public class TimeUtil {
    public void getStartTime(AboutTime aboutTime){
        Date date = new Date();
        aboutTime.starttime = date.getTime();
        SimpleDateFormat simpleDateFormat = new  SimpleDateFormat("yyyy/MM/dd  hh:mm:ss");
        String starttime1 = simpleDateFormat.format(date);
        System.out.println("进站时间:"+starttime1);
    }
    public void getEndTime(AboutTime aboutTime ,long number){
        Date date = new Date();
        aboutTime.endtime = aboutTime.starttime + number * 1000;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd  hh:mm:ss");
        String endtime1 = simpleDateFormat.format(date);
        System.out.println("出站时间："+endtime1);
    }

}
